/**
 * AppConfig.as
 * Copyright 2014 Qunhe Tech, all rights reserved.
 * Qunhe PROPRIETARY/CONFIDENTIAL, any form of usage is subject to approval.
 */
package org.bridge.flash.hi2048
{
    import flash.events.IEventDispatcher;

    import org.bridge.flash.hi2048.model.GameModel;
    import org.bridge.flash.hi2048.view.GridPanel;
    import org.bridge.flash.hi2048.view.GridPanelMediator;

    import robotlegs.bender.extensions.contextView.ContextView;
    import robotlegs.bender.extensions.eventCommandMap.api.IEventCommandMap;
    import robotlegs.bender.extensions.mediatorMap.api.IMediatorMap;
    import robotlegs.bender.framework.api.IConfig;
    import robotlegs.bender.framework.api.IInjector;

    /**
     * @author zhangshuai
     */
    public class AppConfig implements IConfig
    {
        [Inject]
        public var injector:IInjector;

        [Inject]
        public var mediatorMap:IMediatorMap;

        [Inject]
        public var commandMap:IEventCommandMap;

        [Inject]
        public var contextView:ContextView;

        [Inject]
        public var eventDispather:IEventDispatcher;

        public function AppConfig()
        {
        }

        public function configure():void
        {
            configureModel();
            configureService();
            configureView();
            configureController();
        }

        private function configureController():void
        {

        }

        private function configureView():void
        {
            mediatorMap.map(GridPanel).toMediator(GridPanelMediator);
        }

        private function configureService():void
        {
            // TODO Auto Generated method stub

        }

        private function configureModel():void
        {
            injector.map(GameModel).asSingleton();
        }
    }
}
